package com.exchange.View;

import android.content.Context;
import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.RelativeLayout.LayoutParams;
import android.widget.TextView;
import android.widget.ViewFlipper;
import com.exchange.Controller.ExchangeDataService;
import com.exchange.Controller.e;
import com.exchange.Controller.f;
import com.exchange.Public.ExchangeConstants;
import com.exchange.Public.f;
import com.exchange.Public.h;
import com.exchange.Public.m;
import com.exchange.Public.n;
import com.exchange.Public.o;
import com.exchange.View.a.a;
import com.exchange.View.a.b;
import com.exchange.View.a.d;
import com.exchange.View.a.e;
import com.exchange.b.a;
import java.util.List;

public class j
  implements e
{
  Context a;
  ViewGroup b;
  View c;
  int d;
  private f e;
  private a f;
  private ExchangeDataService g;
  private List<a> h;
  private View.OnClickListener i;

  public j(Context paramContext, ViewGroup paramViewGroup, int paramInt, ExchangeDataService paramExchangeDataService)
  {
    this.a = paramContext;
    this.b = paramViewGroup;
    this.d = paramInt;
    this.g = paramExchangeDataService;
    l locall = new l(this);
    this.g.requestDataAsyn(this.a, locall);
  }

  void a()
  {
    TextView localTextView;
    View localView = View.inflate(this.a, a.a(this.a), null);
    ((ImageView)localView.findViewById(b.i(this.a))).setAlpha(ExchangeConstants.banner_alpha);
    ViewFlipper localViewFlipper = (ViewFlipper)localView.findViewById(b.a(this.a));
    localViewFlipper.setFlipInterval(10000);
    localViewFlipper.setInAnimation(AnimationUtils.loadAnimation(this.a, e.a(this.a)));
    localViewFlipper.setOutAnimation(AnimationUtils.loadAnimation(this.a, e.b(this.a)));
    localViewFlipper.addView(View.inflate(this.a, a.g(this.a), null));
    a locala = this.e.d();
    this.f = locala;
    ImageView localImageView1 = (ImageView)localView.findViewById(b.r(this.a));
    if (locala.m == 0)
    {
      n.a("adIconUrl", "result:" + locala.e);
      new f(this.a, localImageView1, locala.e).start();
    }
    ImageView localImageView2 = (ImageView)localView.findViewById(b.i(this.a));
    if (locala.m == 1)
    {
      localViewFlipper.setVisibility(8);
      localImageView1.setVisibility(8);
      if (localImageView2 != null)
      {
        localImageView2.setImageDrawable(null);
        Drawable localDrawable = o.b(this.a, locala.w);
        if (localDrawable == null)
          break label454;
        localImageView2.setImageDrawable(localDrawable);
      }
      ((TextView)localView.findViewById(b.l(this.a))).setText(locala.g);
      localTextView = (TextView)localView.findViewById(b.n(this.a));
      if (!(ExchangeConstants.show_size))
        break label507;
      localTextView.setText(m.a(this.a, locala.n));
    }
    while (true)
    {
      while (true)
      {
        while (true)
        {
          ((TextView)localView.findViewById(b.q(this.a))).setText(locala.a);
          localView.setOnClickListener(new k(this, locala));
          this.c = localView;
          int j = h.a(55, this.a);
          RelativeLayout localRelativeLayout = new RelativeLayout(this.a);
          localRelativeLayout.setLayoutParams(new RelativeLayout.LayoutParams(-1, j));
          localRelativeLayout.setBackgroundColor(Color.alpha(0));
          this.b.addView(localRelativeLayout);
          RelativeLayout.LayoutParams localLayoutParams = new RelativeLayout.LayoutParams(-1, j);
          localLayoutParams.addRule(12);
          localRelativeLayout.addView(this.c, localLayoutParams);
          return;
          label454: new f(this.a, localImageView2, locala.w, Boolean.valueOf(true)).start();
        }
        localImageView1.setVisibility(0);
        localViewFlipper.setVisibility(0);
        localImageView2.setImageResource(d.d(this.a));
      }
      label507: localTextView.setVisibility(8);
    }
  }

  public void a(View.OnClickListener paramOnClickListener)
  {
    this.i = paramOnClickListener;
  }

  // ERROR //
  public void b()
  {
    // Byte code:
    //   0: aload_0
    //   1: getfield 228	com/exchange/View/j:c	Landroid/view/View;
    //   4: invokevirtual 288	android/view/View:getWindowVisibility	()I
    //   7: ifne +397 -> 404
    //   10: getstatic 291	com/exchange/Public/ExchangeConstants:LOG_TAG	Ljava/lang/String;
    //   13: ldc_w 293
    //   16: invokestatic 162	com/exchange/Public/n:a	(Ljava/lang/String;Ljava/lang/String;)V
    //   19: aload_0
    //   20: getfield 55	com/exchange/View/j:e	Lcom/exchange/Controller/f;
    //   23: invokevirtual 129	com/exchange/Controller/f:d	()Lcom/exchange/b/a;
    //   26: astore_2
    //   27: aload_0
    //   28: aload_2
    //   29: putfield 62	com/exchange/View/j:f	Lcom/exchange/b/a;
    //   32: new 295	com/exchange/Controller/a
    //   35: dup
    //   36: iconst_0
    //   37: aload_0
    //   38: getfield 32	com/exchange/View/j:a	Landroid/content/Context;
    //   41: aload_2
    //   42: aload_0
    //   43: getfield 36	com/exchange/View/j:d	I
    //   46: iconst_1
    //   47: iconst_0
    //   48: aload_0
    //   49: getfield 38	com/exchange/View/j:g	Lcom/exchange/Controller/ExchangeDataService;
    //   52: getfield 298	com/exchange/Controller/ExchangeDataService:displayStyle	I
    //   55: invokespecial 301	com/exchange/Controller/a:<init>	(ILandroid/content/Context;Lcom/exchange/b/a;IIII)V
    //   58: invokevirtual 302	com/exchange/Controller/a:start	()V
    //   61: aload_0
    //   62: getfield 228	com/exchange/View/j:c	Landroid/view/View;
    //   65: aload_0
    //   66: getfield 32	com/exchange/View/j:a	Landroid/content/Context;
    //   69: invokestatic 95	com/exchange/View/a/b:a	(Landroid/content/Context;)I
    //   72: invokevirtual 83	android/view/View:findViewById	(I)Landroid/view/View;
    //   75: checkcast 97	android/widget/ViewFlipper
    //   78: astore_3
    //   79: aload_3
    //   80: sipush 5000
    //   83: invokevirtual 100	android/widget/ViewFlipper:setFlipInterval	(I)V
    //   86: aload_3
    //   87: aload_0
    //   88: getfield 32	com/exchange/View/j:a	Landroid/content/Context;
    //   91: aload_0
    //   92: getfield 32	com/exchange/View/j:a	Landroid/content/Context;
    //   95: invokestatic 103	com/exchange/View/a/e:a	(Landroid/content/Context;)I
    //   98: invokestatic 109	android/view/animation/AnimationUtils:loadAnimation	(Landroid/content/Context;I)Landroid/view/animation/Animation;
    //   101: invokevirtual 113	android/widget/ViewFlipper:setInAnimation	(Landroid/view/animation/Animation;)V
    //   104: aload_3
    //   105: aload_0
    //   106: getfield 32	com/exchange/View/j:a	Landroid/content/Context;
    //   109: aload_0
    //   110: getfield 32	com/exchange/View/j:a	Landroid/content/Context;
    //   113: invokestatic 115	com/exchange/View/a/e:b	(Landroid/content/Context;)I
    //   116: invokestatic 109	android/view/animation/AnimationUtils:loadAnimation	(Landroid/content/Context;I)Landroid/view/animation/Animation;
    //   119: invokevirtual 118	android/widget/ViewFlipper:setOutAnimation	(Landroid/view/animation/Animation;)V
    //   122: aload_0
    //   123: getfield 228	com/exchange/View/j:c	Landroid/view/View;
    //   126: aload_0
    //   127: getfield 32	com/exchange/View/j:a	Landroid/content/Context;
    //   130: invokestatic 132	com/exchange/View/a/b:r	(Landroid/content/Context;)I
    //   133: invokevirtual 83	android/view/View:findViewById	(I)Landroid/view/View;
    //   136: checkcast 85	android/widget/ImageView
    //   139: astore 4
    //   141: new 164	com/exchange/Public/f
    //   144: dup
    //   145: aload_0
    //   146: getfield 32	com/exchange/View/j:a	Landroid/content/Context;
    //   149: aload 4
    //   151: aload_2
    //   152: getfield 149	com/exchange/b/a:e	Ljava/lang/String;
    //   155: invokespecial 167	com/exchange/Public/f:<init>	(Landroid/content/Context;Landroid/widget/ImageView;Ljava/lang/String;)V
    //   158: invokevirtual 170	com/exchange/Public/f:start	()V
    //   161: aload_0
    //   162: getfield 228	com/exchange/View/j:c	Landroid/view/View;
    //   165: aload_0
    //   166: getfield 32	com/exchange/View/j:a	Landroid/content/Context;
    //   169: invokestatic 79	com/exchange/View/a/b:i	(Landroid/content/Context;)I
    //   172: invokevirtual 83	android/view/View:findViewById	(I)Landroid/view/View;
    //   175: checkcast 85	android/widget/ImageView
    //   178: astore 5
    //   180: aload_2
    //   181: getfield 137	com/exchange/b/a:m	I
    //   184: iconst_1
    //   185: if_icmpne +272 -> 457
    //   188: getstatic 291	com/exchange/Public/ExchangeConstants:LOG_TAG	Ljava/lang/String;
    //   191: new 141	java/lang/StringBuilder
    //   194: dup
    //   195: aload_2
    //   196: getfield 149	com/exchange/b/a:e	Ljava/lang/String;
    //   199: invokestatic 307	java/lang/String:valueOf	(Ljava/lang/Object;)Ljava/lang/String;
    //   202: invokespecial 146	java/lang/StringBuilder:<init>	(Ljava/lang/String;)V
    //   205: ldc_w 309
    //   208: invokevirtual 153	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   211: aload_2
    //   212: getfield 137	com/exchange/b/a:m	I
    //   215: invokevirtual 312	java/lang/StringBuilder:append	(I)Ljava/lang/StringBuilder;
    //   218: invokevirtual 157	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   221: invokestatic 162	com/exchange/Public/n:a	(Ljava/lang/String;Ljava/lang/String;)V
    //   224: aload_3
    //   225: bipush 8
    //   227: invokevirtual 173	android/widget/ViewFlipper:setVisibility	(I)V
    //   230: aload 5
    //   232: ifnull +35 -> 267
    //   235: aload_0
    //   236: getfield 32	com/exchange/View/j:a	Landroid/content/Context;
    //   239: aload_2
    //   240: getfield 181	com/exchange/b/a:w	Ljava/lang/String;
    //   243: invokestatic 186	com/exchange/Public/o:b	(Landroid/content/Context;Ljava/lang/String;)Landroid/graphics/drawable/Drawable;
    //   246: astore 8
    //   248: aload 8
    //   250: ifnull +180 -> 430
    //   253: aload 5
    //   255: aload 8
    //   257: invokevirtual 178	android/widget/ImageView:setImageDrawable	(Landroid/graphics/drawable/Drawable;)V
    //   260: aload 4
    //   262: bipush 8
    //   264: invokevirtual 174	android/widget/ImageView:setVisibility	(I)V
    //   267: aload_0
    //   268: getfield 32	com/exchange/View/j:a	Landroid/content/Context;
    //   271: aload_0
    //   272: getfield 32	com/exchange/View/j:a	Landroid/content/Context;
    //   275: invokestatic 120	com/exchange/View/a/a:g	(Landroid/content/Context;)I
    //   278: aconst_null
    //   279: invokestatic 75	android/view/View:inflate	(Landroid/content/Context;ILandroid/view/ViewGroup;)Landroid/view/View;
    //   282: astore 6
    //   284: aload_3
    //   285: aload 6
    //   287: invokevirtual 124	android/widget/ViewFlipper:addView	(Landroid/view/View;)V
    //   290: aload 6
    //   292: aload_0
    //   293: getfield 32	com/exchange/View/j:a	Landroid/content/Context;
    //   296: invokestatic 189	com/exchange/View/a/b:l	(Landroid/content/Context;)I
    //   299: invokevirtual 83	android/view/View:findViewById	(I)Landroid/view/View;
    //   302: checkcast 191	android/widget/TextView
    //   305: aload_2
    //   306: getfield 193	com/exchange/b/a:g	Ljava/lang/String;
    //   309: invokevirtual 197	android/widget/TextView:setText	(Ljava/lang/CharSequence;)V
    //   312: aload 6
    //   314: aload_0
    //   315: getfield 32	com/exchange/View/j:a	Landroid/content/Context;
    //   318: invokestatic 200	com/exchange/View/a/b:n	(Landroid/content/Context;)I
    //   321: invokevirtual 83	android/view/View:findViewById	(I)Landroid/view/View;
    //   324: checkcast 191	android/widget/TextView
    //   327: astore 7
    //   329: getstatic 204	com/exchange/Public/ExchangeConstants:show_size	Z
    //   332: ifeq +151 -> 483
    //   335: aload 7
    //   337: aload_0
    //   338: getfield 32	com/exchange/View/j:a	Landroid/content/Context;
    //   341: aload_2
    //   342: getfield 207	com/exchange/b/a:n	J
    //   345: invokestatic 212	com/exchange/Public/m:a	(Landroid/content/Context;J)Ljava/lang/String;
    //   348: invokevirtual 197	android/widget/TextView:setText	(Ljava/lang/CharSequence;)V
    //   351: aload 6
    //   353: aload_0
    //   354: getfield 32	com/exchange/View/j:a	Landroid/content/Context;
    //   357: invokestatic 215	com/exchange/View/a/b:q	(Landroid/content/Context;)I
    //   360: invokevirtual 83	android/view/View:findViewById	(I)Landroid/view/View;
    //   363: checkcast 191	android/widget/TextView
    //   366: aload_2
    //   367: getfield 217	com/exchange/b/a:a	Ljava/lang/String;
    //   370: invokevirtual 197	android/widget/TextView:setText	(Ljava/lang/CharSequence;)V
    //   373: aload_3
    //   374: invokevirtual 315	android/widget/ViewFlipper:showNext	()V
    //   377: aload_3
    //   378: invokevirtual 318	android/widget/ViewFlipper:getChildCount	()I
    //   381: iconst_3
    //   382: if_icmpne +8 -> 390
    //   385: aload_3
    //   386: iconst_0
    //   387: invokevirtual 321	android/widget/ViewFlipper:removeViewAt	(I)V
    //   390: new 323	com/exchange/Controller/h
    //   393: dup
    //   394: aload_0
    //   395: invokespecial 326	com/exchange/Controller/h:<init>	(Lcom/exchange/Controller/e;)V
    //   398: invokevirtual 327	com/exchange/Controller/h:start	()V
    //   401: goto +92 -> 493
    //   404: getstatic 291	com/exchange/Public/ExchangeConstants:LOG_TAG	Ljava/lang/String;
    //   407: ldc_w 329
    //   410: invokestatic 162	com/exchange/Public/n:a	(Ljava/lang/String;Ljava/lang/String;)V
    //   413: goto +80 -> 493
    //   416: astore_1
    //   417: getstatic 291	com/exchange/Public/ExchangeConstants:LOG_TAG	Ljava/lang/String;
    //   420: aload_1
    //   421: invokevirtual 332	java/lang/Exception:getMessage	()Ljava/lang/String;
    //   424: invokestatic 334	com/exchange/Public/n:c	(Ljava/lang/String;Ljava/lang/String;)V
    //   427: goto +66 -> 493
    //   430: new 164	com/exchange/Public/f
    //   433: dup
    //   434: aload_0
    //   435: getfield 32	com/exchange/View/j:a	Landroid/content/Context;
    //   438: aload 5
    //   440: aload_2
    //   441: getfield 181	com/exchange/b/a:w	Ljava/lang/String;
    //   444: iconst_1
    //   445: invokestatic 271	java/lang/Boolean:valueOf	(Z)Ljava/lang/Boolean;
    //   448: invokespecial 274	com/exchange/Public/f:<init>	(Landroid/content/Context;Landroid/widget/ImageView;Ljava/lang/String;Ljava/lang/Boolean;)V
    //   451: invokevirtual 170	com/exchange/Public/f:start	()V
    //   454: goto -194 -> 260
    //   457: aload 4
    //   459: iconst_0
    //   460: invokevirtual 174	android/widget/ImageView:setVisibility	(I)V
    //   463: aload_3
    //   464: iconst_0
    //   465: invokevirtual 173	android/widget/ViewFlipper:setVisibility	(I)V
    //   468: aload 5
    //   470: aload_0
    //   471: getfield 32	com/exchange/View/j:a	Landroid/content/Context;
    //   474: invokestatic 278	com/exchange/View/a/d:d	(Landroid/content/Context;)I
    //   477: invokevirtual 281	android/widget/ImageView:setImageResource	(I)V
    //   480: goto -213 -> 267
    //   483: aload 7
    //   485: bipush 8
    //   487: invokevirtual 282	android/widget/TextView:setVisibility	(I)V
    //   490: goto -139 -> 351
    //   493: return
    //
    // Exception table:
    //   from	to	target	type
    //   0	413	416	java/lang/Exception
    //   430	490	416	java/lang/Exception
  }
}